import React from 'react'
import ReactDOM from 'react-dom'

// 1. js普通函数构造组件
// function Welcome(props) {
//   return <h1>hi, { props.name }</h1>
// }

// 2. es6中class构造组件
class Welcome extends React.Component {
  render() {
    return <h1>hi, { this.props.name }</h1>
  }
}

const element = <Welcome name="box" />

ReactDOM.render(
  element,
  document.getElementById('root')
)